{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="ibox float-e-margins">
        <div class="ibox-content">
            <div class="row">
                <!--搜索框开始-->
                <div class="col-sm-12">
                    <div class="layui-form layui-form-item">


                    </div>
                </div>

                <div class="col-sm-12">

                </div>
                <!--搜索框结束-->
                <!--操作框开始-->
                <!--<div class="col-sm-12">-->
                    <!--<div class="input-group" >-->
                        <!--<button  class="btn btn-danger m-l-xs" href="javascript:;" data-toggle="dropdown">-->
                            <!--<i class="fa fa-wrench"></i> 批量操作 <span class="caret"></span>-->
                        <!--</button>-->
                        <!--<ul class="dropdown-menu layui-anim layui-anim-upbit" role="menu">-->
                            <!--<li><a  href="javascript:;" class="layuiBtn" data-type="excelAll"><i class="fa fa-external-link"></i> 批量导出</a></li>-->
                            <!--<li><a  href="javascript:;" class="layuiBtn" data-type="excelAllNoSelect"><i class="fa fa-external-link"></i> 全部导出</a></li>-->
                        <!--</ul>-->
                    <!--</div>-->
                <!--</div>-->
                <!--操作框结束-->
            </div>
            <div class="hr-line-dashed"></div>

            <div class="example-wrap">
                <div class="example">
                    <table class="layui-hide" id="test" lay-filter="demo"></table>
                    <!--修改状态模板-->
                    <!--<script type="text/html" id="staBar">-->
                    <!--<input type="checkbox" value="{{d.school_id}}"  lay-skin="switch"  lay-text="上架中|已下架" lay-filter="OnOff" {{ d.school_status == 1 ? 'checked' : '' }} >-->
                    <!--</script>-->

                    <!--状态显示模板-->
                    <script type="text/html" id="imgTpl">


                    </script>
                    <!--操作模板-->
                    <script type="text/html" id="s_status">
                        {{# if(d.s_status == 1){ }}
                        报备中
                        {{# } }}
                        {{# if(d.s_status == 2){ }}
                        已加盟
                        {{# } }}
                        {{# if(d.s_status > 2){ }}
                        已过期
                        {{# } }}
                    </script>


                    <script type="text/html" id="opeBar">
                        <a href="javascript:;" onclick="wk.confirm('{{d.s_id}}','{:url('dynDel')}','会删除此报备下的跟进记录，确定删除吗?')" class="btn btn-danger btn-xs m-r-xs" title="删除">删除</a>
                    </script>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    //layui渲染数据表格
    layui.use('table', function () {
        var table = layui.table
                , form = layui.form;
        table.render({
            elem: '#test'
            , url: '{:url("dyn/rimShop")}'
            ,response: {
                statusCode: 220 //成功的状态码，默认：0
            }
            , page: 0
            , size: 'lg' //sm小尺寸的表格 lg大尺寸
            , cellMinWidth: 150
            , limits: [5, 10, 15, 20, 25, 300]
            , limit: "{:config('pages')}"
            , loading: true
            , id: 'testReload'
            , cols: [[
                {field: 's_id', width: 80, title: 'ID', align: 'center'}
                , {field: 's_u_name', width: '', title: '报备人', align: 'center'}
                , {field: 's_u_phone', width: 140, title: '手机号', align: 'center'}
                , {field: 's_com_name', width: 150, title: '客户公司', align: 'center'}
                , {field: 's_name', width: '', title: '联系人', align: 'center'}
                , {field: 's_phone', width: '', title: '联系电话', align: 'center',templet: '#s_phone'}
                , {field: 's_area_str', width: '', title: '客户地址', align: 'center'}
                , {field: 's_address', width: '', title: '地址详情', align: 'center'}
                , {field: 's_status', width: 90, fixed: 'right',title: '报备状态', align: 'center',templet: '#s_status'}
                // , {fixed: 'right', width:120, title: '操作', align: 'center', toolbar: '#opeBar'}
            ]]
            ,done: function (res, curr, count) {
                $('.aaasss').viewer({
                    url: 'data-original'
                });
            }
        });
        //批量操作
        var $ = layui.$, active = {
            //批量导出订单
            excelAll:function () {
                wk.excelAll(getIds(),$('.layui-input').serialize(),"{:url('outExcel')}");
            },
            //全部导出
            excelAllNoSelect:function () {
                wk.excelAll('all',$('.layui-input').serialize(),"{:url('outExcel')}");
            }
        };
        $('.layuiBtn').on('click', function () {
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });
        var getIds = function () {
            var ids = [];
            var checkStatus = table.checkStatus('testReload')
                    ,data = checkStatus.data;
            $.each(data,function(index,item){
                ids.push(item['s_id'])
            });
            return ids;
        }
    });
</script>
</body>
</html>